/*
 * RTSAI - Real-Time Strategy engine for AI research
 * Copyright(C) 2006 DIMAp-UFRN, licensed under LGPL
 *
 * UnitState implementation ( UnitState.cpp )
 */

// INCLUDES ===================================================================
#include <string>
#include <iostream>
#include "UnitState.h"
#include "Unit.h"
#include "GameEvent.h"
#include "Common.h"

// IMPLEMENTATIONS ============================================================
// PUBLIC METHODS +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

void UnitState :: listen_to ( GameEvent *event )
{
    event -> add_listener ( this );
    listening_to.push_front ( event );
}

// Destructor -----------------------------------------------------------------
/*! Destructor
 */
UnitState :: ~UnitState ()
{
    foreach ( l, listening_to )
        (*l)-> remove_listener ( this );
}
